// import { get } from "@/http/http";


export function perpetualTradeInfo(value) {
    console.log(value);
    // get('/data/basic/perpetual').then(res => {
    //     console.log(res, 'res');
        const { asset } = JSON.parse(localStorage.getItem('userInfo'));
        // petualPriceInput(price)
        availableArea(asset)
    // })
}

// function petualPriceInput(value) {
//     const priceInput = document.querySelector('.trade-input-container > .mantine-1k9wln4 > .mantine-ysl0gg')
//     if (priceInput) {
//         priceInput.value = value.toFixed(2);

//         const event = new Event("input", { bubbles: true });
//         priceInput.dispatchEvent(event);
//     } else {
//         console.log('未找到.trade-input-container > .mantine-1k9wln4 > .mantine-ysl0gg');

//     }
// }

function availableArea(value) {
    const availableInput = document.querySelector('.dealbox > .flex-between > div > span:nth-child(2)')
    console.log(availableInput, value, 'aaaaaavaaaaaaaillllllablee');
    if (availableInput) {
        availableInput.innerText = `${Number(value).toFixed(2)} USDT`;
        console.log(availableInput.innerText, "availableInput.innerText");
    } else {
        console.log("未找到.trade-panel-available > div > span节点");
    }
} 